package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name = "黄桑";
        int age = 22;
        String gender = "男";
        String[] otherInfo={"技术好"};
        Person person = new Person(name,age,gender,otherInfo);
        System.out.println(person);

        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("person.obj"));
        oos.writeObject(person);
        System.out.println("OK");
        oos.close();
    }
}
